package com.auntvt.timo.jpax.springbootstarter.helper;

/**
 * 数据状态工具
 *
 * @author 小懒虫
 * @date 2019/2/19
 */
public class LogicDelete {
    /**
     * 逻辑删除字段名称
     */
    public static final String FIELD_NAME = "deleted";

    /**
     * 正常的字段值
     */
    public static final String NORMAL_VALUE = "0";

    /**
     * 已逻辑删除的字段值
     */
    public static final String DELETE_VALUE = "1";

    /**
     * 逻辑删除语句
     */
    public static final String SLICE_DELETE = " set " + FIELD_NAME + "=" + DELETE_VALUE + " WHERE id=?";

    /**
     * 逻辑删除语句-需写“ WHERE id=?”
     * 在自定义主键名称时使用
     */
    public static final String SLICE_DELETE_NO_ID = " set " + FIELD_NAME + "=" + DELETE_VALUE;

    /**
     * 不等于逻辑删除的条件语句
     */
    public static final String WHERE_NOT_DELETE = FIELD_NAME + " != " + DELETE_VALUE;
}
